home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / Retrace.h < prev    next >
Text File  |  1995-07-06  |  4KB  |  163 lines

  1. /*
  2.      File:        Retrace.h
  3.  
  4.      Contains:    Vertical Retrace Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __RETRACE__
  21. #define __RETRACE__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __OSUTILS__
  30. #include <OSUtils.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33. /*    #include <Memory.h>                                            */
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_ALIGN_SUPPORTED
  40. #pragma options align=mac68k
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT_SUPPORTED
  44. #pragma import on
  45. #endif
  46.  
  47. typedef struct VBLTask VBLTask, *VBLTaskPtr;
  48.  
  49. /*
  50.         VBLProcPtr uses register based parameters on the 68k and cannot
  51.         be written in or called from a high-level language without the help of
  52.         mixed mode or assembly glue.
  53.  
  54.             typedef pascal void (*VBLProcPtr)(VBLTaskPtr vblTaskPtr);
  55.  
  56.         In:
  57.          => vblTaskPtr      A0.L
  58. */
  59.  
  60. #if GENERATINGCFM
  61. typedef UniversalProcPtr VBLUPP;
  62. #else
  63. typedef Register68kProcPtr VBLUPP;
  64. #endif
  65.  
  66. struct VBLTask {
  67.     QElemPtr                        qLink;
  68.     short                            qType;
  69.     VBLUPP                            vblAddr;
  70.     short                            vblCount;
  71.     short                            vblPhase;
  72. };
  73. enum {
  74.     uppVBLProcInfo = kRegisterBased
  75.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(VBLTaskPtr)))
  76. };
  77.  
  78. #if GENERATINGCFM
  79. #define NewVBLProc(userRoutine)        \
  80.         (VBLUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppVBLProcInfo, GetCurrentArchitecture())
  81. #else
  82. #define NewVBLProc(userRoutine)        \
  83.         ((VBLUPP) (userRoutine))
  84. #endif
  85.  
  86. #if GENERATINGCFM
  87. #define CallVBLProc(userRoutine, vblTaskPtr)        \
  88.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppVBLProcInfo, (vblTaskPtr))
  89. #else
  90. /* (*VBLProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  91. #endif
  92.  
  93. extern pascal QHdrPtr GetVBLQHdr(void)
  94.  THREEWORDINLINE(0x2EBC, 0x0000, 0x0160);
  95.  
  96. #if !GENERATINGCFM
  97. #pragma parameter __D0 SlotVInstall(__A0, __D0)
  98. #endif
  99. extern pascal OSErr SlotVInstall(QElemPtr vblBlockPtr, short theSlot)
  100.  ONEWORDINLINE(0xA06F);
  101.  
  102. #if !GENERATINGCFM
  103. #pragma parameter __D0 SlotVRemove(__A0, __D0)
  104. #endif
  105. extern pascal OSErr SlotVRemove(QElemPtr vblBlockPtr, short theSlot)
  106.  ONEWORDINLINE(0xA070);
  107.  
  108. #if !GENERATINGCFM
  109. #pragma parameter __D0 AttachVBL(__D0)
  110. #endif
  111. extern pascal OSErr AttachVBL(short theSlot)
  112.  ONEWORDINLINE(0xA071);
  113.  
  114. #if !GENERATINGCFM
  115. #pragma parameter __D0 DoVBLTask(__D0)
  116. #endif
  117. extern pascal OSErr DoVBLTask(short theSlot)
  118.  ONEWORDINLINE(0xA072);
  119.  
  120. #if !GENERATINGCFM
  121. #pragma parameter __D0 VInstall(__A0)
  122. #endif
  123. extern pascal OSErr VInstall(QElemPtr vblTaskPtr)
  124.  ONEWORDINLINE(0xA033);
  125.  
  126. #if !GENERATINGCFM
  127. #pragma parameter __D0 VRemove(__A0)
  128. #endif
  129. extern pascal OSErr VRemove(QElemPtr vblTaskPtr)
  130.  ONEWORDINLINE(0xA034);
  131. /**/
  132. /* Custom Glue for 68k.*/
  133. /**/
  134. #if !GENERATINGCFM
  135. #ifndef CallVBLProc
  136.  
  137. #if !GENERATINGCFM
  138. #pragma parameter VBLProcPtr68K(__A1, __A0)
  139. #endif
  140. extern pascal void VBLProcPtr68K(VBLUPP userRoutine, VBLTaskPtr userTask)
  141.  FIVEWORDINLINE(0x48E7, 0xF030, 0x4E91, 0x4CDF, 0x0C0F);
  142. /* Movem A2-A3/D0-D3,-(SP)*/
  143. /* Jsr (A1)*/
  144. /* Movem (SP)+,A2-A3/D0-D3*/
  145. #define CallVBLProc(userRoutine, vblTaskPtr)  \
  146.     VBLProcPtr68K(userRoutine, vblTaskPtr);
  147. #endif
  148. #endif
  149.  
  150. #if PRAGMA_IMPORT_SUPPORTED
  151. #pragma import off
  152. #endif
  153.  
  154. #if PRAGMA_ALIGN_SUPPORTED
  155. #pragma options align=reset
  156. #endif
  157.  
  158. #ifdef __cplusplus
  159. }
  160. #endif
  161.  
  162. #endif /* __RETRACE__ */
  163.